-- shop_cost
-- created by xinj
-- 某类商店出售商品价格降低

return {
    apply = function(prop, baseValue)
        local rate = prop[3];

        -- 最大削减量
        local limitShop = { "smuggler_shop", "smuggler_shop_1", "component",
                            "gear_shop", "gear_shop_1", };

        if table.indexOf(limitShop, prop[2]) >= 0 then
            rate = math.min(300, prop[3]);
        end

        return baseValue - math.modf(baseValue * rate / 1000);
    end,

    record = function(target, prop, path)
        return false;
    end
};